import Https from '@/utils/https'

// 页面上方的统计
const querySummaryReq = (params) => Https.get('/api/v1/flink/record/running/summary', params)

// 查询日志
const queryLogReq = (params) => Https.get('/api/v1/flink/record/running/detail', params, { needCode: true })

// 重跑任务
const queryRestartReq = (params) => Https.post('/api/v1/flink/record/running/restart', params, { needCode: true })

// 试跑
const runningRetryReq = (params) => Https.post('/api/v1/flink/record/running/retry', params, { needCode: true, json: false })

// 停止任务
const queryStopReq = (params) => Https.post('/api/v1/flink/record/running/stop', params, { needCode: true, json: false })

// 获取checkpoints
const realtimeRunningCheckpoints = (params) => Https.get('/api/v1/flink/record/running/checkpoints', params, { needCode: true })
// 获取最新的Savepoint
const realtimeRunningSavepoint = (params) => Https.get('/api/v1/flink/record/running/getLastSavepoint', params, { needCode: true })
// 续跑
const realtimeRunningContinue = (params) => Https.post('/api/v1/flink/record/running/continue', params, { needCode: true, json: false })

export {
  realtimeRunningContinue, realtimeRunningSavepoint, realtimeRunningCheckpoints, runningRetryReq, querySummaryReq, queryLogReq, queryRestartReq, queryStopReq,
}
